Pull metrics from multiple modules into a single "Project Metrics" module

I've found some great dxl on this forum and I thank you for that. I'm now able to ask a more educated question based on reviewing, modifying, and running some DXL.

As you can see in the attached image I have 3 requirements modules; all of which have the same attributes etc. There are 2 linksets; SRD -> CDD and CDD -> ICD. I created the Project Metrics module to illustrate what I'd like to accomplish. While I already have this exact view wihthin the individual modules I'd like to create a single module that can give program management a view across the entire program at a glance.

Attribute descriptions are as folows;

  1. of Reqs: Requirement attribute = TRUE
  2. of Orphans: Requirement attribute = TRUE and no out-link to the appropriate module (NA for ICD)
  3. of Childless: Requirement attribute = TRUE and no in-link from the appropriate module (NA for SRD)
  4. of Open Change Proposals: Change Proposal Status = not Approved AND not Rejected
Total # of Change Proposals: all change proposals of all status

Any recommendations or ideas would be greatly appreciated!

Regards,
Anthony
SystemAdmin - Thu Sep 23 16:20:03 EDT 2010

Re: Pull metrics from multiple modules into a single "Project Metrics" module
Mathias Mamsch - Fri Sep 24 17:48:28 EDT 2010

I would probably do the following:

I would define a Report Template, that contains two module attributes.

1. Evaluation List Text: Should contain a list of all modules that shall be evaluated.

Example content:
/MyProject/Module 1
/MyProject/Module 2

2. Report Elements Text: Should contain a list of attributes and a list of DXL filter expressions to apply.
Example content:

  1. of Reqs: attribute "Requirement" == "TRUE"
  2. of Orphans: attribute "Requirement" == "TRUE" && hasNoLinks(linkFilterOutgoing, "*")


Then I would write a small DXL script, that will:

a) open all the modules in the Evaluation List
b) for each report element, apply the filter and write the element count to the attribute.

It could look very much like the below script. This way you can have different report modules and each report module can contain multiple report runs (for each run a top level object is created). Just put a view in there that will show the columns you need. You can pretty much report on anything you can filter, it would probably take only minor additions to make this script execute a custom DXL in the target module to report on anything.

I just wanted to know how fast this could be coded. Hope it helps, regards, Mathias

 

void setFilter (Module m, string filtStr) {
    string code = "noError(); Module m = addr_ " ((addr_ m) int) "\ncurrent=m\nFilter f = " filtStr"\n; set f"
        eval_ code;  
}
 
Regexp reSplit = regexp ".*"
Skip splitLines (string s) { 
    Skip sk = create(); int count = 0; 
    while (!null s && reSplit s) { put (sk, count++, s[match 0] ""); s= s[end 0 + 2:]; }
        return sk
}
 
bool existsAttr (Module m, string n) { AttrDef ad = find(m, n); return !null ad }
 
Module repMod = current
if (!isEdit repMod || !existsAttr (repMod, "Report Elements") || !existsAttr(repMod, "Evaluation List") ) {
        ack "Start this script from a reports module opened in exclusive edit!"
        halt
}
 
Skip skFilters = splitLines (repMod."Report Elements" "")
Skip skMods    = splitLines (repMod."Evaluation List" "")
 
Object objReport = create repMod
objReport."Object Heading" = "Report from: " (dateAndTime today) ""
Regexp reFilter = regexp "^\\s*([^:]+):(.*)$"
 
string sMod, sRep; 
for sMod in skMods do { 
        current = repMod
        Object objResult = create last below objReport  
        Module evalMod = read(sMod, false, true) 
        objResult."Object Text" = fullName evalMod; 
        if (null evalMod) { print "Module " sMod " could not be opened. Skipping.\n"; continue } 
        for sRep in skFilters do { 
                if (reFilter sRep) {
                        string sAttr   = sRep[match 1]
                        string sFilter = sRep[match 2]
                        noError()
                                int accepted = 0, rejected = 0
                                if (!existsAttr(repMod, sAttr)) { current = repMod; AttrDef ad = create object type "Integer" attribute sAttr }
                                setFilter (evalMod, sFilter);                           
                                current = evalMod
                                Filter f = current; set(evalMod, f, accepted, rejected) 
                        string errMsg = lastError() 
                        objResult.sAttr = accepted
                        if (!null errMsg) { 
                                print "Could not evaluate '" sRep "' for '" sMod "'. Message: " errMsg                            
                        } 
                }
        }
        close evalMod; evalMod = null
}

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Pull metrics from multiple modules into a single "Project Metrics" module
Mathias Mamsch - Fri Sep 24 18:34:43 EDT 2010

Mathias Mamsch - Fri Sep 24 17:48:28 EDT 2010

I would probably do the following:

I would define a Report Template, that contains two module attributes.

1. Evaluation List Text: Should contain a list of all modules that shall be evaluated.

Example content:
/MyProject/Module 1
/MyProject/Module 2

2. Report Elements Text: Should contain a list of attributes and a list of DXL filter expressions to apply.
Example content:

  1. of Reqs: attribute "Requirement" == "TRUE"
  2. of Orphans: attribute "Requirement" == "TRUE" && hasNoLinks(linkFilterOutgoing, "*")


Then I would write a small DXL script, that will:

a) open all the modules in the Evaluation List
b) for each report element, apply the filter and write the element count to the attribute.

It could look very much like the below script. This way you can have different report modules and each report module can contain multiple report runs (for each run a top level object is created). Just put a view in there that will show the columns you need. You can pretty much report on anything you can filter, it would probably take only minor additions to make this script execute a custom DXL in the target module to report on anything.

I just wanted to know how fast this could be coded. Hope it helps, regards, Mathias

 

void setFilter (Module m, string filtStr) {
    string code = "noError(); Module m = addr_ " ((addr_ m) int) "\ncurrent=m\nFilter f = " filtStr"\n; set f"
        eval_ code;  
}
 
Regexp reSplit = regexp ".*"
Skip splitLines (string s) { 
    Skip sk = create(); int count = 0; 
    while (!null s && reSplit s) { put (sk, count++, s[match 0] ""); s= s[end 0 + 2:]; }
        return sk
}
 
bool existsAttr (Module m, string n) { AttrDef ad = find(m, n); return !null ad }
 
Module repMod = current
if (!isEdit repMod || !existsAttr (repMod, "Report Elements") || !existsAttr(repMod, "Evaluation List") ) {
        ack "Start this script from a reports module opened in exclusive edit!"
        halt
}
 
Skip skFilters = splitLines (repMod."Report Elements" "")
Skip skMods    = splitLines (repMod."Evaluation List" "")
 
Object objReport = create repMod
objReport."Object Heading" = "Report from: " (dateAndTime today) ""
Regexp reFilter = regexp "^\\s*([^:]+):(.*)$"
 
string sMod, sRep; 
for sMod in skMods do { 
        current = repMod
        Object objResult = create last below objReport  
        Module evalMod = read(sMod, false, true) 
        objResult."Object Text" = fullName evalMod; 
        if (null evalMod) { print "Module " sMod " could not be opened. Skipping.\n"; continue } 
        for sRep in skFilters do { 
                if (reFilter sRep) {
                        string sAttr   = sRep[match 1]
                        string sFilter = sRep[match 2]
                        noError()
                                int accepted = 0, rejected = 0
                                if (!existsAttr(repMod, sAttr)) { current = repMod; AttrDef ad = create object type "Integer" attribute sAttr }
                                setFilter (evalMod, sFilter);                           
                                current = evalMod
                                Filter f = current; set(evalMod, f, accepted, rejected) 
                        string errMsg = lastError() 
                        objResult.sAttr = accepted
                        if (!null errMsg) { 
                                print "Could not evaluate '" sRep "' for '" sMod "'. Message: " errMsg                            
                        } 
                }
        }
        close evalMod; evalMod = null
}

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Sorry the formatting in my post got messed up. You need to create two module attributes "Report Elements" and "Evaluation List" of type text and put the following text in there:
 

Report Elements: (put 'attribute':'dxl filter expression' lines here, attributes will be created on first evaluation) 
# of Reqs: attribute "Requirement" == "TRUE"
# of Orphans: attribute "Requirement" == "TRUE" && hasNoLinks(linkFilterOutgoing, "*")
 
Evaluation List: (put the modules to be evaluated here)
/MyProject/MyModule 1
/MyProject/MyModule 2

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: Pull metrics from multiple modules into a single "Project Metrics" module
SystemAdmin - Wed Aug 01 07:08:17 EDT 2012

Mathias Mamsch - Fri Sep 24 18:34:43 EDT 2010

Sorry the formatting in my post got messed up. You need to create two module attributes "Report Elements" and "Evaluation List" of type text and put the following text in there:
 

Report Elements: (put 'attribute':'dxl filter expression' lines here, attributes will be created on first evaluation) 
# of Reqs: attribute "Requirement" == "TRUE"
# of Orphans: attribute "Requirement" == "TRUE" && hasNoLinks(linkFilterOutgoing, "*")
 
Evaluation List: (put the modules to be evaluated here)
/MyProject/MyModule 1
/MyProject/MyModule 2

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

hi
can anyone help me with this one. i have setup my modules as described and work briliantly! thanks mathias! i want to add in the last baseline number of each module to the output module. i have tried and tried and tried but cant get it to do it!

thanks very much anyone!

Re: Pull metrics from multiple modules into a single "Project Metrics" module
Mathias Mamsch - Wed Aug 01 12:07:57 EDT 2012

SystemAdmin - Wed Aug 01 07:08:17 EDT 2012
hi
can anyone help me with this one. i have setup my modules as described and work briliantly! thanks mathias! i want to add in the last baseline number of each module to the output module. i have tried and tried and tried but cant get it to do it!

thanks very much anyone!

Oh wow ... after two years this post finally draws someones attention ;-) Without trying I think you can just do:
 

...
objResult."Object Text" = (fullName evalMod) (version evalMod)  // <<-- added 'version evalMod'
...


To get the version of the module in the report. Maybe this helps, regards, Mathias

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Pull metrics from multiple modules into a single "Project Metrics" module
SystemAdmin - Mon Aug 06 04:36:21 EDT 2012

Mathias Mamsch - Wed Aug 01 12:07:57 EDT 2012

Oh wow ... after two years this post finally draws someones attention ;-) Without trying I think you can just do:
 

...
objResult."Object Text" = (fullName evalMod) (version evalMod)  // <<-- added 'version evalMod'
...


To get the version of the module in the report. Maybe this helps, regards, Mathias

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Brilliant! Thanks so much

It works a treat!

Re: Pull metrics from multiple modules into a single "Project Metrics" module
Cami - Sun Dec 14 15:19:56 EST 2014

Hi,

Unfortunately I'm quite new in all is related to DOORS. 

So, maybe I will ask the most stupid question in the world: How can I create those 2 module attributes for Metrics Module?

Every time when I try to create them, after I create the module attributes I can't add them to my View(in order to insert the path to my formal modules).

I have to collect Metrics weekly for mote than 20 documents and all I succeed to create until now was a small DXL script that counts a single attribute from a single formal module: e.g. I'm in Module A and my script tells me that I have 150 reqs with Agreed status, 20 reqs with To Clarify status and 45 reqs with Not Agreed status.

Can somebody help me?

 

Thanks

Re: Pull metrics from multiple modules into a single "Project Metrics" module
Mathias Mamsch - Sun Dec 14 16:39:15 EST 2014

Cami - Sun Dec 14 15:19:56 EST 2014

Hi,

Unfortunately I'm quite new in all is related to DOORS. 

So, maybe I will ask the most stupid question in the world: How can I create those 2 module attributes for Metrics Module?

Every time when I try to create them, after I create the module attributes I can't add them to my View(in order to insert the path to my formal modules).

I have to collect Metrics weekly for mote than 20 documents and all I succeed to create until now was a small DXL script that counts a single attribute from a single formal module: e.g. I'm in Module A and my script tells me that I have 150 reqs with Agreed status, 20 reqs with To Clarify status and 45 reqs with Not Agreed status.

Can somebody help me?

 

Thanks

A module attribute cannot be edited in the view ... A module attribute needs to be created over the attributes dialog, but then modified over File / Module Properties ... In the listview you can see the module attributes and then press a button or double click to edit. Regards, Mathias